package com.mygo.designPattern.behavioral.chainOfResponsibilityPattern;

public class LoggingSystem {
    public static void main(String[] args) {
        // 创建日志处理器
        Logger infoLogger = new InfoLogger();
        Logger debugLogger = new DebugLogger();
        Logger errorLogger = new ErrorLogger();

        // 设置责任链
        infoLogger.setNextLogger(debugLogger);
        debugLogger.setNextLogger(errorLogger);

        // 记录不同级别的日志
        infoLogger.logMessage(LogLevel.INFO, "这是一条信息日志。");
        infoLogger.logMessage(LogLevel.DEBUG, "这是一条调试日志。");
        infoLogger.logMessage(LogLevel.ERROR, "这是一条错误日志。");
    }
}